import service from '@/utils/request'

// @Tags Drug
// @Summary 创建商品
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Drug true "创建商品"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /drug/createDrug [post]
export const createDrug = (data) => {
  return service({
    url: '/drug/createDrug',
    method: 'post',
    data
  })
}

// @Tags Drug
// @Summary 删除商品
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Drug true "删除商品"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /drug/deleteDrug [delete]
export const deleteDrug = (params) => {
  return service({
    url: '/drug/deleteDrug',
    method: 'delete',
    params
  })
}

// @Tags Drug
// @Summary 批量删除商品
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除商品"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /drug/deleteDrugByIds [delete]
export const deleteDrugByIds = (params) => {
  return service({
    url: '/drug/deleteDrugByIds',
    method: 'delete',
    params
  })
}

// @Tags Drug
// @Summary 更新商品
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Drug true "更新商品"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /drug/updateDrug [put]
export const updateDrug = (data) => {
  return service({
    url: '/drug/updateDrug',
    method: 'put',
    data
  })
}

// @Tags Drug
// @Summary 用id查询商品
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Drug true "用id查询商品"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /drug/findDrug [get]
export const findDrug = (params) => {
  return service({
    url: '/drug/findDrug',
    method: 'get',
    params
  })
}

// @Tags Drug
// @Summary 分页获取商品列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.PageInfo true "分页获取商品列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /drug/getDrugList [get]
export const getDrugList = (params) => {
  return service({
    url: '/drug/getDrugList',
    method: 'get',
    params
  })
}

// @Tags Drug
// @Summary 设置商品文章
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.DrugArticleReq true "设置商品文章"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"设置成功"}"
// @Router /drug/setDrugArticle [post]
export const setDrugArticle = (data) => {
  return service({
    url: '/drug/setDrugArticle',
    method: 'post',
    data
  })
}

// @Tags Drug
// @Summary 获取商品文章
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.DrugArticleReq true "获取商品文章"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /drug/getDrugArticle [get]
export const getDrugArticle = (params) => {
  return service({
    url: '/drug/getDrugArticle',
    method: 'get',
    params
  })
}
